package com.yzc.android.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import com.yzc.android.R;
import com.yzc.android.beans.BannerInfoBean;
import com.yzc.android.ui.base.fragment.NavBarBaseFragment;
import com.yzc.android.widget.banner.SliderBanner;
import com.yzc.android.widget.banner.SliderBannerManager;

/**
 * Created by yzc on 16/4/25.
 */
public class SliderBannerDemoFragment extends NavBarBaseFragment {

    @Bind(R.id.demo_slider_banner)
    protected SliderBanner mSliderBanner;

    @Override
    public View onCreateView(final LayoutInflater inflater,
                             final ViewGroup container,
                             final Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        List<BannerInfoBean> bannerList = new ArrayList<>();
        BannerInfoBean banner1 = new BannerInfoBean();
        banner1.imgUrl = "http://pic2.ooopic.com/10/79/87/15b1OOOPIC40.jpg";
        bannerList.add(banner1);

        BannerInfoBean banner2 = new BannerInfoBean();
        banner2.imgUrl = "http://pic34.nipic.com/20131031/11712251_135356579136_2.jpg";
        bannerList.add(banner2);

        BannerInfoBean banner3 = new BannerInfoBean();
        banner3.imgUrl = "http://www.njyxwzhs.com/images/01.jpg";
        bannerList.add(banner3);

        final SliderBannerManager sliderBannerController = new SliderBannerManager(mSliderBanner);
        sliderBannerController.play(bannerList);

        return view;
    }

    @Override
    public int getLayout() {
        return R.layout.layout_fragment_slider_banner;
    }

    @Override
    public void pullToRefreshHandler() {

    }
}
